Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for invalid conversion rate (SlowMist N3) #139

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

clostao
Copy link
Contributor

@clostao clostao commented Nov 7, 2023

Description

Slowmist problem description:

If the value of conversion_rate.1 is 0, it may lead to a program panic. This is because in Rust, when performing
integer division, dividing by 0 will result in a panic. Such a situation is considered undefined behavior, and Rust
detects division by 0 at runtime and panics to ensure program safety.

Our response:

Applied suggested changes

Types of changes

What types of changes does your code introduce?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@clostao clostao changed the title Add check for invalid conversion rate Add check for invalid conversion rate (SlowMist N3) Nov 7, 2023
Copy link
Contributor

@GabrielMartinezRodriguez GabrielMartinezRodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

deblanco
deblanco previously approved these changes Nov 9, 2023
@deblanco deblanco dismissed stale reviews from GabrielMartinezRodriguez and themself via a4279f5 November 15, 2023 21:43
@deblanco deblanco force-pushed the fix-invalid-conversion-rate branch from b55805d to a4279f5 Compare November 15, 2023 21:43
@deblanco deblanco merged commit 1a2d38a into main Nov 16, 2023
1 check failed
@deblanco deblanco deleted the fix-invalid-conversion-rate branch November 16, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants